package utils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.junit.jupiter.api.Test;

import com.alibaba.fastjson.JSON;
import com.bo.wei.chen.mybatis.model.RiskDecisionResultDto;
import com.bo.wei.chen.mybatis.model.User;

import net.minidev.json.JSONObject;

/**
 * TODO
 *
 * @author chenwb25485
 * @version V2.1
 * @since 2020/10/29 9:45
 */
public class json {

    public static void main(String[] args) {
        Map<String, Object> riskResponse = new HashMap<>();
        riskResponse.put("USER_ID", "4799231194265534546");
        riskResponse.put("microCreditRiskDto", "123");
        riskResponse.put("fraudRiskLevel", "123");
        riskResponse.put("hitDetail", "123");
        riskResponse.put("applyResult", "A");
        riskResponse.put("creditScore", "123");
        riskResponse.put("riskLevelList", " [{\n" + "    \"riskItemId\": \"fraudRiskLevel\",\n"
            + "    \"riskItemName\": \"欺诈风险等级\",\n" + "    \"riskLevelValue\": \"中\",\n" + "    \"ruleList\": [{\n"
            + "      \"ruleKey\": \"idAddress\",\n" + "      \"ruleValue\": \"身份证归属地不同\"\n" + "    }]\n" + "  }]");
        RiskDecisionResultDto riskDecisionResultDto = RiskDecisionResultDto.builder()
            .applyId("4799231194265534541")
            .bizType("INVESTIGATE")
            .riskResponse(riskResponse)
            .build();
        String s = JSON.toJSONString(riskDecisionResultDto);
        System.out.println(s);

    }
}
